package org.linlinjava.litemall.admin.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.linlinjava.litemall.admin.beans.annotation.LogAnno;
import org.linlinjava.litemall.admin.dto.AdminScheduledJobLogDTO;
import org.linlinjava.litemall.admin.service.AdminScheduledJobLogService;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "任务日志API")
@RestController
@RequestMapping("/admin/scheduled/log")
@RequiredArgsConstructor
public class AdminScheduledJobLogController extends ResponseUtil {

    private final AdminScheduledJobLogService adminScheduledJobLogService;

    @ApiOperation("定时任务-「列表｜查找」")
    @PostMapping("/logs")
    @LogAnno
    public Response logs(@RequestBody AdminScheduledJobLogDTO scheduledJobLogDTO){
        return adminScheduledJobLogService.logs(scheduledJobLogDTO);
    }

}
